/*
runTime: 0.0008
fileTree:
 +---- page/getPage.js
 |  +---- cpt/LJSDefine.js
 |  +---- cpt/cptLeft.js
*/
/*
分页跳转
*/
/**
 * Copyright (c) 2010 - 2012, Sina Inc. All rights reserved.
 * @fileoverview Sina  合辑承载页包含epg信息部分
 * @author bowen liu | liubowen082@163.com
 * @version 1.1 | 2013-4-13
 * @example
 * 
 */
if(typeof(LJS)=='undefined'){
	var LJS = {}
}
LJS.define = (function(){
    /**
	 * @id STK.register
	 * @alias STK.register
	 * @param {String} String
	 * @param {Function} Function
	 * @return {Void}
	 */
    var define = function(ns, maker) {
        var path = ns.split('.');
        var curr = LJS;
        for (var i = 0, len = path.length; i < len; i += 1) {
            if (i == len - 1) {
                if (curr[path[i]] !== undefined) {
                    throw ns + 'has been register!!!';
                }
                curr[path[i]] = maker(LJS);
                return true;
            }
            if (curr[path[i]] === undefined) {
                curr[path[i]] = {};
            }
            curr = curr[path[i]];
        }
    };
    
    
    return define
    
    
    
})();

/**
 * Copyright (c) 2010 - 2012, Sina Inc. All rights reserved.
 * @fileoverview Sina  左侧导航
 * @author bowen liu | liubowen082@163.com
 * @version 1.1 | 2013-4-13
 * @example
 * 
 */


LJS.define('cpt.cptLeft',function(){

	var _root = $('#sidebar-left [node_type="root"]');
	
	$('#sidebar-left [isOpen="true"]').next('ul').show();
	
	
	_root.on('click','a',function(){
		$(this).parent().next('ul').toggle();
	})
	
	

});

$('#getNextPageNum').on('click',function(){
   		var val = $('#pageNumber').val()
   		var loc = window.location.href;
   		if(/page=.?&{0,1}/.test(loc)){
   			window.location.href = loc.replace(/page=\d+/,'page='+val)
   		}else if(/\?/.test(loc)){
   			window.location.href = loc + '&page='+val
			
   		}else{
   			window.location.href = loc + '?page='+val
			
   		}
   		return false;
   })